port=8080
if [ "$#" -gt 0 ]; then
    # At least 1 argument was passed in, so assume it is the PID
      echo "arg1=$1"
    port="$1"
fi
if netstat -anp | grep "$port" > /dev/null; then
  echo  "端口 $port 已被占用"
else
  echo "端口 $port 未被占用"
fi
